#include <iostream>

using std::cout;
using std::endl;

class Base
{
public:
    Base(long base): _base(base) 
    {  cout << "Base(long)" << endl;    }

    virtual
    void print() const
    {   cout << "_base:" << _base << endl;}

    void print(int x) const 
    {
        cout << "x:" << x << endl;
    }

private:
    long _base;
};

class Derived
: public Base
{
public:
    Derived(long base, long derived)
    : Base(base)
    , _derived(derived)
    {   cout << "Derived1(long,long)" << endl;}

    void print() const  override
    {   cout << "Derived1::_derived:" << _derived << endl;    }


private:
    long _derived;
};


int main()
{
    Derived d1(10, 100);
    //通过对象调用虚函数时，就不再表现虚函数的特性
    d1.print();//表现的是隐藏机制
    d1.print(1);//error 这里也表现的是隐藏机制

    return 0;
}

